﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CreditNoteDisplay.aspx.cs" Inherits="Main_Reports_ServiceInvoice_CreditNoteDisplay" Culture="en-GB" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagPrefix="UserControl" TagName="Heading" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Credit Note View</title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function OpenDetails(CreditNoteId) {
            window.open('CreditNoteView.aspx?CreditNoteId=' + CreditNoteId, '', 'width=800,height=600, top=30,left=20');
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width:100%" class="divmain">
        <UserControl:Heading  ID="pageHeading" runat="server" HeadingText="Credit Note Detials" />
    </div>
    <div style="width:80%; margin-left:10%; margin-right:10%; margin-top:10px;">
        <asp:GridView ID="grdDisplay" Width="100%" runat="server" CssClass="gridview" 
        AutoGenerateColumns="false" DataKeyNames="CreditNoteId" OnRowDataBound="grdDisplay_RowBound">
            <Columns>
                <asp:TemplateField HeaderText="S.No">
                    <ItemTemplate>
                        <%# Container.DataItemIndex+1 %>
                    </ItemTemplate>
                </asp:TemplateField>               
                <asp:BoundField HeaderText="Credit Note No." DataField="VouNumber"/>              
                <asp:BoundField HeaderText="Date" DataField="VouDate" DataFormatString="{0:dd-MMM-yyyy}" />
                <asp:BoundField HeaderText="Customer" DataField="Lname" />
                <asp:BoundField HeaderText="Total Amt." DataField="Total" DataFormatString="{0:0.00}" ItemStyle-HorizontalAlign="Right" />
                <asp:BoundField HeaderText="Credit Type" DataField="CreditType" />
                 <asp:TemplateField HeaderText="View">
                    <ItemTemplate>
                        <asp:HyperLink ID="hyperView" NavigateUrl="#" runat="server">View</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>  
            </Columns>
            <EmptyDataTemplate>
                No Record found !!
            </EmptyDataTemplate>
            <EmptyDataRowStyle HorizontalAlign="Center" ForeColor="Red" Font-Bold="true" />
        </asp:GridView>
    </div>
    </form>
</body>
</html>

<%--SELECT
IVC_CREDITNOTE_MAIN.CREDITNOTEID,
CASE WHEN IVC_TRANSACTIONFORMAT_NUMBERS.PREFIX!='' THEN IVC_TRANSACTIONFORMAT_NUMBERS.PREFIX+'/' ELSE IVC_TRANSACTIONFORMAT_NUMBERS.PREFIX END
+ ACC_VOUCHERS.VOUNO
+ CASE WHEN IVC_TRANSACTIONFORMAT_NUMBERS.SUFFIX!='' THEN '/'+IVC_TRANSACTIONFORMAT_NUMBERS.SUFFIX ELSE IVC_TRANSACTIONFORMAT_NUMBERS.SUFFIX END AS VOUNUMBER,
ACC_VOUCHERS.VOUDATE,
ACC_VOUCHERS.FINYEAR,
IVC_CREDITNOTE_MAIN.CUSTOMERLEDGERID,
ACC_LEDMAST.LNAME,
IVC_CREDITNOTE_TOTAL.TOTAL
FROM ACC_VOUCHERS
INNER JOIN IVC_CREDITNOTE_MAIN ON 
IVC_CREDITNOTE_MAIN.TRANID=ACC_VOUCHERS.TRANID
INNER JOIN ACC_LEDMAST ON 
IVC_CREDITNOTE_MAIN.CUSTOMERLEDGERID=ACC_LEDMAST.LID
INNER JOIN IVC_TRANSACTIONFORMAT_NUMBERS ON
IVC_CREDITNOTE_MAIN.FORMATID=IVC_TRANSACTIONFORMAT_NUMBERS.FORMATID
INNER JOIN IVC_CREDITNOTE_TOTAL ON
IVC_CREDITNOTE_TOTAL.CREDITNOTEID=IVC_CREDITNOTE_MAIN.CREDITNOTEID
--%>